//引入异步请求
import request from "@/utils/request"
//引入接口
enum Api{
  //获取spu列表的接口
  getSpuListApi = '/admin/product',
  //获取添加spu属性的接口

  SaveSpuApi = '/admin/product/saveSpuInfo',
  //删除spU属性的
  delteSpuApi = '/admin/product/deleteSpu/{spuId}',
  //修改Spu属性
  EditSpuApi = '/admin/product/updateSpuInfo',
  //获取基本的销售属性
  BaseSaleAttrlistApi = '/admin/product/baseSaleAttrList',
  //获取全部的品牌数据的接口
  AllTrademarkApi ='/admin/product/baseTrademark/getTrademarkList'
}
import { useCategorySelectorStore } from "@/stores/categorySelector"
const Selector = useCategorySelectorStore()

//获取spu属性列表的数据的方法
export const reqGetSpuListData = (page: number, limit: number, category3Id: number) => request.get(Api.getSpuListApi + `/${page}/${limit}?category3Id=${Selector.category3Id}`)
//获取全部的品牌的数据的方法
export const reqAllTrademarkData = () => request.get(Api.AllTrademarkApi);
//获取销售的属性
export const reqSaleAttrData=()=>request.get(Api.BaseSaleAttrlistApi)